cce0f1076cdbcf6eaaabfd9f4244ff4f874bb710,source/org/jasig/portal/layout/AggregatedUserLayoutImpl.java,AggregatedUserLayoutImpl,setUserLayoutDOM,#Node#String#,1159
Before Change
nodeDesc.setId(nodeId);
nodeDesc.setName(node.getAttribute("name"));
nodeDesc.setFragmentId(node.getAttribute("fragmentID"));
nodeDesc.setHidden((node.getAttribute("hidden").equalsIgnoreCase("true"))?true:false);
nodeDesc.setImmutable((node.getAttribute("immutable").equalsIgnoreCase("true"))?true:false);
nodeDesc.setUnremovable((node.getAttribute("unremovable").equalsIgnoreCase("true"))?true:false);
nodeDesc.setHidden((node.getAttribute("hidden").equalsIgnoreCase("true"))?true:false);
ALNode layoutNode = null;
IALChannelDescription channelDesc = null;
if (nodeDesc instanceof IALChannelDescription)
channelDesc = (IALChannelDescription) nodeDesc;
// Getting parameters and restrictions
for ( int i = 0; i < childNodes.getLength(); i++ ) {
Node childNode = childNodes.item(i);
String nodeName = childNode.getNodeName();
NamedNodeMap attributes = childNode.getAttributes();
if ( PARAMETER.equals(nodeName) && channelDesc != null ) {
Node paramNameNode = attributes.getNamedItem("name");
String paramName = (paramNameNode!=null)?paramNameNode.getFirstChild().getNodeValue():null;
Node paramValueNode = attributes.getNamedItem("value");
String paramValue = (paramValueNode!=null)?paramValueNode.getFirstChild().getNodeValue():null;
Node overParamNode = attributes.getNamedItem("override");
String overParam = (overParamNode!=null)?overParamNode.getFirstChild().getNodeValue():null;
if ( paramName != null ) {
channelDesc.setParameterValue(paramName, paramValue);
channelDesc.setParameterOverride(paramName, "yes".equalsIgnoreCase(overParam)?true:false);
}
} else if ( RESTRICTION.equals(nodeName) ) {
Node restrPathNode = attributes.getNamedItem("path");
String restrPath = (restrPathNode!=null)?restrPathNode.getFirstChild().getNodeValue():null;
Node restrValueNode = attributes.getNamedItem("value");
String restrValue = (restrValueNode!=null)?restrValueNode.getFirstChild().getNodeValue():null;
Node restrTypeNode = attributes.getNamedItem("type");
String restrType = (restrTypeNode!=null)?restrTypeNode.getFirstChild().getNodeValue():"0";
if ( restrValue != null ) {
IUserLayoutRestriction restriction = UserLayoutRestrictionFactory.createRestriction(CommonUtils.parseInt(restrType),restrValue,restrPath);
nodeDesc.addRestriction(restriction);
}
}
}
if ( channelDesc != null ) {
channelDesc.setChannelPublishId(node.getAttribute("chanID"));
channelDesc.setChannelTypeId(node.getAttribute("typeID"));
channelDesc.setClassName(node.getAttribute("class"));
channelDesc.setDescription(node.getAttribute("description"));
channelDesc.setEditable((node.getAttribute("editable").equalsIgnoreCase("true"))?true:false);
channelDesc.setHasAbout((node.getAttribute("hasAbout").equalsIgnoreCase("true"))?true:false);
channelDesc.setHasHelp((node.getAttribute("hasHelp").equalsIgnoreCase("true"))?true:false);
channelDesc.setFunctionalName(node.getAttribute("fname"));
channelDesc.setTimeout(Long.parseLong(node.getAttribute("timeout")));
channelDesc.setTitle(node.getAttribute("title"));
After Change
nodeDesc.setId(nodeId);
nodeDesc.setName(node.getAttribute("name"));
nodeDesc.setFragmentId(node.getAttribute("fragmentID"));
nodeDesc.setHidden(CommonUtils.strToBool(node.getAttribute("hidden")));
nodeDesc.setImmutable(CommonUtils.strToBool(node.getAttribute("immutable")));
nodeDesc.setUnremovable(CommonUtils.strToBool(node.getAttribute("unremovable")));
nodeDesc.setHidden(CommonUtils.strToBool(node.getAttribute("hidden")));
ALNode layoutNode = null;
IALChannelDescription channelDesc = null;
if (nodeDesc instanceof IALChannelDescription)
channelDesc = (IALChannelDescription) nodeDesc;
// Getting parameters and restrictions
for ( int i = 0; i < childNodes.getLength(); i++ ) {
Node childNode = childNodes.item(i);
String nodeName = childNode.getNodeName();
NamedNodeMap attributes = childNode.getAttributes();
if ( PARAMETER.equals(nodeName) && channelDesc != null ) {
Node paramNameNode = attributes.getNamedItem("name");
String paramName = (paramNameNode!=null)?paramNameNode.getFirstChild().getNodeValue():null;
Node paramValueNode = attributes.getNamedItem("value");
String paramValue = (paramValueNode!=null)?paramValueNode.getFirstChild().getNodeValue():null;
Node overParamNode = attributes.getNamedItem("override");
String overParam = (overParamNode!=null)?overParamNode.getFirstChild().getNodeValue():null;
if ( paramName != null ) {
channelDesc.setParameterValue(paramName, paramValue);
channelDesc.setParameterOverride(paramName, "yes".equalsIgnoreCase(overParam)?true:false);
}
} else if ( RESTRICTION.equals(nodeName) ) {
Node restrPathNode = attributes.getNamedItem("path");
String restrPath = (restrPathNode!=null)?restrPathNode.getFirstChild().getNodeValue():null;
Node restrValueNode = attributes.getNamedItem("value");
String restrValue = (restrValueNode!=null)?restrValueNode.getFirstChild().getNodeValue():null;
Node restrTypeNode = attributes.getNamedItem("type");
String restrType = (restrTypeNode!=null)?restrTypeNode.getFirstChild().getNodeValue():"0";
if ( restrValue != null ) {
IUserLayoutRestriction restriction = UserLayoutRestrictionFactory.createRestriction(CommonUtils.parseInt(restrType),restrValue,restrPath);
nodeDesc.addRestriction(restriction);
}
}
}
if ( channelDesc != null ) {
channelDesc.setChannelPublishId(node.getAttribute("chanID"));
channelDesc.setChannelTypeId(node.getAttribute("typeID"));
channelDesc.setClassName(node.getAttribute("class"));
channelDesc.setDescription(node.getAttribute("description"));
channelDesc.setEditable(CommonUtils.strToBool(node.getAttribute("editable")));
channelDesc.setHasAbout(CommonUtils.strToBool(node.getAttribute("hasAbout")));
channelDesc.setHasHelp(CommonUtils.strToBool(node.getAttribute("hasHelp")));
channelDesc.setFunctionalName(node.getAttribute("fname"));
channelDesc.setTimeout(Long.parseLong(node.getAttribute("timeout")));
channelDesc.setTitle(node.getAttribute("title"));